﻿/**********************************************************************
* @file   FITKAcousticsFESubSysMgrAdaptor.h
* @brief  子系统管理器数据 读写适配器
* @author yangjing (1195810980@qq.com)
* @date   2025-02-25
*********************************************************************/

#ifndef _FITFK_ACOUSTICS_FE_SUB_SYS_MANAGER_ADAPTOR_H___
#define _FITFK_ACOUSTICS_FE_SUB_SYS_MANAGER_ADAPTOR_H___

#include "FITKAcousticsAbstractAdaptor.h"
#include "FITK_Kernel/FITKCore/FITKCoreMacros.h"
#include "FITK_Kernel/FITKAdaptor/FITKIOAdaptorFactory.h"
#include <H5Cpp.h>
namespace IO {
    class FITKHDF5FileTool;
}

namespace Acoustics {
    class FITKAcousticsFESubSysManager;
    class FITKAbstractFESubSys;
}

namespace IO
{
    class FITKAcousticsHDF5IOAPI FITKAcousticsFESubSysMgrAdaptor : public FITKAcousticsAbsAdaptor
    {
    public:
        explicit FITKAcousticsFESubSysMgrAdaptor() = default;
        virtual ~FITKAcousticsFESubSysMgrAdaptor() = default;

        virtual bool adaptR() override;

        virtual bool adaptW() override;

    private:

        /**
        * @brief 读FE子系统数据
        * @param @param[i]  gp hdf5组别
        * @param @param[i]  FESubSysManager   子系统管理器
        * @author yangjing (1195810980@qq.com)
        * @date 2025-1-23
        */
        bool readFESubSysMgr(H5::Group &gp, Acoustics::FITKAcousticsFESubSysManager* FESubSysManager);



        /**
        * @brief 写FE子系统数据
        * @param @param[i]  gp hdf5组别
        * @param @param[i]  FESubSysManager   子系统管理器
        * @author yangjing (1195810980@qq.com)
        * @date 2025-1-23
        */
        bool writeFESubSysMgr(H5::Group &gp, Acoustics::FITKAcousticsFESubSysManager* FESubSysManager);
    

        /**
        * @brief 写FE子系统父类数据
        * @param @param[i]  gp hdf5组别
        * @param @param[i]  sys   抽象父类数据
        * @author yangjing (1195810980@qq.com)
        * @date 2025-1-23
        */
        bool writeParent(H5::Group&gp, Acoustics::FITKAbstractFESubSys* sys);


        /**
        * @brief 读FE子系统父类数据
        * @param @param[i]  gp hdf5组别
        * @param @param[i]  sys   抽象父类数据
        * @author yangjing (1195810980@qq.com)
        * @date 2025-1-23
        */
        bool readParent(H5::Group&gp, Acoustics::FITKAbstractFESubSys* sys);
    private:

        IO::FITKHDF5FileTool*m_toolp{ nullptr };
    };
    Register2FITKIOAdaptorFactory(FITKAcousticsHDF5, Acoustics::FITKAcousticsFESubSysManager, FITKAcousticsFESubSysMgrAdaptor);
}
#endif
